Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment: Dockerfile and Smithery config #2

Merged
merged 5 commits into from
Feb 10, 2025

Conversation

calclavia
Copy link
Contributor

This pull request introduces the following updates:

  • Dockerfile: Introduces a Dockerfile to package the MCP for deployment across various environments.
  • Smithery Configuration: Adds a Smithery YAML file, which specifies how to start the MCP and the configuration options it supports. It allows you to deploy your MCP to Smithery, serving it over WebSockets so end-users do not need to install additional dependencies. To deploy, merge this PR, then visit your server page and click "Deploy" under the deployments page.
  • README: Updates the README to include installation instructions via Smithery and a popularity badge. Note that the installation only works after the server is deployed on Smithery.

Please review these updates to verify their accuracy for your server and feel free to customize it to your needs. Let me know if you have any questions. 🙂

@jkawamoto
Copy link
Owner

Thank you for your PR!

I attempted to build the Docker image, but I encountered the following error:

ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref 5023d32e-bf28-4716-a4a0-4d96ffdd554e::o2nk09jl9t7c5kztp5ik5xgkz: "/root/.local": not found
docker build -t mcp-youtube-transcript --no-cache .

[+] Building 4.3s (14/15)                                                                                  docker:orbstack
 => [internal] load build definition from Dockerfile                                                                  0.0s
 => => transferring dockerfile: 1.24kB                                                                                0.0s
 => [internal] load metadata for ghcr.io/astral-sh/uv:python3.12-bookworm-slim                                        1.1s
 => [internal] load metadata for docker.io/library/python:3.12-slim-bookworm                                          0.7s
 => [auth] library/python:pull token for registry-1.docker.io                                                         0.0s
 => [internal] load .dockerignore                                                                                     0.0s
 => => transferring context: 2B                                                                                       0.0s
 => [uv 1/5] FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim@sha256:42ec966fdda128f2eec01ce71af317f408dfbb0ca927d  0.0s
 => => resolve ghcr.io/astral-sh/uv:python3.12-bookworm-slim@sha256:42ec966fdda128f2eec01ce71af317f408dfbb0ca927d8af  0.0s
 => [stage-1 1/4] FROM docker.io/library/python:3.12-slim-bookworm@sha256:34656cd90456349040784165b9decccbcee4de66f3  0.0s
 => [internal] load build context                                                                                     0.0s
 => => transferring context: 7.06kB                                                                                   0.0s
 => CACHED [uv 2/5] WORKDIR /app                                                                                      0.0s
 => CACHED [stage-1 2/4] WORKDIR /app                                                                                 0.0s
 => [uv 3/5] RUN --mount=type=cache,target=/root/.cache/uv     --mount=type=bind,source=uv.lock,target=uv.lock     -  1.7s
 => [uv 4/5] ADD . /app                                                                                               0.0s 
 => [uv 5/5] RUN --mount=type=cache,target=/root/.cache/uv     uv sync --frozen --no-dev --no-editable                1.2s 
 => ERROR [stage-1 3/4] COPY --from=uv /root/.local /root/.local                                                      0.0s 
------                                                                                                                     
 > [stage-1 3/4] COPY --from=uv /root/.local /root/.local:                                                                 
------                                                                                                                     
Dockerfile:30
--------------------
  28 |     WORKDIR /app
  29 |     
  30 | >>> COPY --from=uv /root/.local /root/.local
  31 |     COPY --from=uv --chown=app:app /app/.venv /app/.venv
  32 |     
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref 5023d32e-bf28-4716-a4a0-4d96ffdd554e::o2nk09jl9t7c5kztp5ik5xgkz: "/root/.local": not found

Could you confirm if I'm missing anything in the setup or build step?

@calclavia
Copy link
Contributor Author

calclavia commented Feb 10, 2025

Thank you for your PR!

I attempted to build the Docker image, but I encountered the following error:

ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref 5023d32e-bf28-4716-a4a0-4d96ffdd554e::o2nk09jl9t7c5kztp5ik5xgkz: "/root/.local": not found
docker build -t mcp-youtube-transcript --no-cache .

[+] Building 4.3s (14/15)                                                                                  docker:orbstack
 => [internal] load build definition from Dockerfile                                                                  0.0s
 => => transferring dockerfile: 1.24kB                                                                                0.0s
 => [internal] load metadata for ghcr.io/astral-sh/uv:python3.12-bookworm-slim                                        1.1s
 => [internal] load metadata for docker.io/library/python:3.12-slim-bookworm                                          0.7s
 => [auth] library/python:pull token for registry-1.docker.io                                                         0.0s
 => [internal] load .dockerignore                                                                                     0.0s
 => => transferring context: 2B                                                                                       0.0s
 => [uv 1/5] FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim@sha256:42ec966fdda128f2eec01ce71af317f408dfbb0ca927d  0.0s
 => => resolve ghcr.io/astral-sh/uv:python3.12-bookworm-slim@sha256:42ec966fdda128f2eec01ce71af317f408dfbb0ca927d8af  0.0s
 => [stage-1 1/4] FROM docker.io/library/python:3.12-slim-bookworm@sha256:34656cd90456349040784165b9decccbcee4de66f3  0.0s
 => [internal] load build context                                                                                     0.0s
 => => transferring context: 7.06kB                                                                                   0.0s
 => CACHED [uv 2/5] WORKDIR /app                                                                                      0.0s
 => CACHED [stage-1 2/4] WORKDIR /app                                                                                 0.0s
 => [uv 3/5] RUN --mount=type=cache,target=/root/.cache/uv     --mount=type=bind,source=uv.lock,target=uv.lock     -  1.7s
 => [uv 4/5] ADD . /app                                                                                               0.0s 
 => [uv 5/5] RUN --mount=type=cache,target=/root/.cache/uv     uv sync --frozen --no-dev --no-editable                1.2s 
 => ERROR [stage-1 3/4] COPY --from=uv /root/.local /root/.local                                                      0.0s 
------                                                                                                                     
 > [stage-1 3/4] COPY --from=uv /root/.local /root/.local:                                                                 
------                                                                                                                     
Dockerfile:30
--------------------
  28 |     WORKDIR /app
  29 |     
  30 | >>> COPY --from=uv /root/.local /root/.local
  31 |     COPY --from=uv --chown=app:app /app/.venv /app/.venv
  32 |     
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref 5023d32e-bf28-4716-a4a0-4d96ffdd554e::o2nk09jl9t7c5kztp5ik5xgkz: "/root/.local": not found

Could you confirm if I'm missing anything in the setup or build step?

Hmm there might be a bug in the generated Dockerfile. Could you try removing this line?

COPY --from=uv /root/.local /root/.local

If that still doesn't work, perhaps we can try a single-stage build (less efficient, but should work)?

@jkawamoto
Copy link
Owner

Removing that line resolved the issue for me. Thank you!

I will proceed to update and merge this PR.

@jkawamoto jkawamoto merged commit d656dc5 into jkawamoto:main Feb 10, 2025
1 check passed
@jkawamoto
Copy link
Owner

@calclavia I tried running the following command:

npx -y @smithery/cli install @jkawamoto/mcp-youtube-transcript --client claude

However, I encountered this error:

Error: No connection configuration found
    at Oi.selectPreferredConnection (/Users/junpei/.npm/_npx/2d0620bb1d41b604/node_modules/@smithery/cli/dist/index.js:88:17247)
    at Oi.installServer (/Users/junpei/.npm/_npx/2d0620bb1d41b604/node_modules/@smithery/cli/dist/index.js:88:17542)
    at dP (/Users/junpei/.npm/_npx/2d0620bb1d41b604/node_modules/@smithery/cli/dist/index.js:95:498)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async nSe (/Users/junpei/.npm/_npx/2d0620bb1d41b604/node_modules/@smithery/cli/dist/index.js:113:2649)

Node.js v23.7.0

Am I missing something?

@calclavia
Copy link
Contributor Author

@calclavia I tried running the following command:

npx -y @smithery/cli install @jkawamoto/mcp-youtube-transcript --client claude

However, I encountered this error:

Error: No connection configuration found
    at Oi.selectPreferredConnection (/Users/junpei/.npm/_npx/2d0620bb1d41b604/node_modules/@smithery/cli/dist/index.js:88:17247)
    at Oi.installServer (/Users/junpei/.npm/_npx/2d0620bb1d41b604/node_modules/@smithery/cli/dist/index.js:88:17542)
    at dP (/Users/junpei/.npm/_npx/2d0620bb1d41b604/node_modules/@smithery/cli/dist/index.js:95:498)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async nSe (/Users/junpei/.npm/_npx/2d0620bb1d41b604/node_modules/@smithery/cli/dist/index.js:113:2649)

Node.js v23.7.0

Am I missing something?

You have to deploy on Smithery first before the CLI command will work. Otherwise, we don't have your server served up for clients yet.

@jkawamoto
Copy link
Owner

I see. So the @smithery/cli command doesn't work with local servers, does it?

@calclavia
Copy link
Contributor Author

I see. So the @smithery/cli command doesn't work with local servers, does it?

Not for now. We're developing a way to pull servers and run it locally so it'll support both local and remote servers in the next few months. It's WIP!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants